home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload Trio 2 / Shareware Overload Trio Volume 2 (Chestnut CD-ROM).ISO / dir36 / runcount.zip / RUNCOUNT.DOC next >
Text File  |  1993-11-30  |  6KB  |  161 lines

  1.     RunCounT - Count and errorlevel exit utility - Glen Gilbert 1:157/534
  2.     ─────────────────────────────────────────────────────────────────────
  3.     RunCounT version 0.0        11-30-1993
  4.  
  5.     What:
  6.     ────
  7.     RunCounT [RCT_log] 5 99
  8.  
  9.     RunCounT simply keeps track of the number of times it is invoked and
  10.     stores that information in its own log file. It checks that log file
  11.     each time it is run. If the number of times it has been run reaches
  12.     the first number specified on the RunCounT command line,  the record
  13.     log file is deleted and RunCounT places the second number found on
  14.     the command line in memory as an errorlevel.  Dos can then interpret
  15.     this value via the batch program language. This in turn can allow
  16.     the OS to react accordingly. See the examples below...
  17.  
  18.     Why:
  19.     ───
  20.     By running RunCounT from a batch file you can operate a utility
  21.     after so many iterations. One application is for purging or packing
  22.     a message base such as invoking Squish's sqpack. Another is the
  23.     periodic running of an echo or file area manager such as seal. You
  24.     can run RunCounT from your autoexec.bat to optimize your drive
  25.     after so many reboots, etc..
  26.  
  27.     How, when and where:
  28.     ───────────────────
  29.     Syntax: RunCounT 5 99 /q /f
  30.  
  31.     Creates a default file named COUNT.RCT if no count file name is
  32.     specified and it is run in the current directory. The /f will
  33.     have RunCounT create the minimum size log file for disk space and
  34.     speed conservation. The number 5 allows RunCounT to be invoked 5
  35.     times before deleting the COUNT.RCT and exiting with an errorlevel
  36.     of 99. No screen output will be produced because of the /q switch.
  37.  
  38.     The only command line arguments required are the 1st and 2nd numbers
  39.     (execution limit) and (errorlevel exit value) in that order.
  40.  
  41.     * Type RunCounT all by itself to see a full description of usage.
  42.  
  43.     Example: Purge or pack your squish message base(s) from a batch file.
  44.  
  45.     :tos
  46.     squish in out squash
  47.     RunCounT msgpak 10 1
  48.     if errorlevel 1 sqpack \bt\msg\*.sqd
  49.  
  50.     Example: Run Echo area manager
  51.  
  52.     :seal
  53.     RunCounT 5 1
  54.     if errorlevel 1 goto do_seal_stuff
  55.     goto do_other_stuff
  56.  
  57.     :do_seal_stuff
  58.      SEAL BAD
  59.      SEAL DESCRIBE ECHO C:\BT\FIDONET.NA
  60.      SEAL SCAN
  61.      Squish in out squash
  62.  
  63.     :do_other_stuff
  64.     echo CONTINUING PROCESS:::
  65.  
  66.     Note: these are only cuts and not a complete batch file. This
  67.     example is for an electronic mail process, the aftermail batch file
  68.     would likely contain many commands. These snips assume you would tell
  69.     your batch file to jump to the label :tos and :seal after mail has
  70.     been received etc..
  71.  
  72.     RunCounT can operate several functions by giving it different count
  73.     record log names. The potential to use RunCounT in two different ways
  74.     from the same batch file is shown below. Applications are not limited
  75.     as long as you do not run out of record log names.
  76.  
  77.     RunCounT sq_poll 20 99
  78.     if errorlevel 99 squish poll 8:100/0
  79.     RunCounT mspgpak 10 98
  80.     if errorlevel 98 sqpack c:\bt\msg\*.sqd
  81.  
  82.     Note:  Always test errorlevels in descending order.
  83.  
  84.     RunCounT sq_poll 20 99
  85.     if errorlevel 99 goto do_this
  86.     if errorlevel 98 goto do_that
  87.  
  88.     Limits:
  89.     ──────
  90.     Significant errorlevels 1 - 255
  91.     Execution limits        2 - 4,294,967,295
  92.  
  93.     Minimum values:  RunCounT 2 1
  94.     Maximum values:  RunCounT 4294967295 255
  95.  
  96.     Control:
  97.     ───────
  98.     /q -q  QUIET Mode (no screen output)
  99.     /f -f  FastMode   (minimum record logging)
  100.  
  101.     Using the F switch
  102.  
  103.     D:\MAX> RunCounT maint 300 99 /f
  104.  
  105.     RunCounT - Count and exit with errorlevel - Glen Gilbert
  106.     ────────────────────────────────────────────────────────
  107.     FastMode no-log:  ON
  108.     CountRecrd File:  maint.rct
  109.     Execution Limit:  300
  110.     Exit errorlevel:  99
  111.     Open RecordFile:  maint.rct
  112.     Storing Count #:  1
  113.  
  114.     RunCounT keeps a log of its own operation in order to determine
  115.     when it is time to exit with the specific errorlevel. This log
  116.     will always be deleted on the final execution. However it grows
  117.     quite large when RunCounT is given a high execution limit. The
  118.     log will look something like this.
  119.  
  120.     1           Nov 29 14:20:13 1993
  121.     2           Nov 29 14:20:15 1993
  122.     3           Nov 29 14:20:16 1993
  123.     4           Nov 29 14:20:16 1993
  124.     5           Nov 29 14:20:17 1993
  125.  
  126.     With an execution limit of 300 this log will eventually contain
  127.     299 entries before it is deleted. Not only does this take up disk
  128.     space, the speed of RunCounT diminishes as the log grows. To avoid
  129.     this, use the /f (fastmode) switch. Only the current execution
  130.     value and timestamp will be contained in the log rather than the
  131.     previous ones. The reason for accumulating execution numbers and
  132.     timestamp information (the default) is for operation analysis. You
  133.     may view the log anytime before the execution limit and subsequent
  134.     dos errorlevel exit.
  135.  
  136.     ────────────────────────────────────────────────────────
  137.  
  138.     RunCounT is free but it is not to be packaged with other software
  139.     without the author's consent. Nor may other software be packaged
  140.     with RunCounT. If it is to be distributed, the archive must contain
  141.     this document (RunCounT.doc) and original unaltered executable.
  142.  
  143.     Use RunCounT at your own risk. The author takes NO responsibility
  144.     for any possible damage which could occur due to its use.  If you
  145.     are skeptical about the safety of using this program and do not
  146.     wish to take precautionary measures to insure RunCounT will do no
  147.     damage, then do not use it.
  148.  
  149.     Acknowledgement, comments and suggestions of a constructive
  150.     nature are appreciated. Please send them to:
  151.  
  152.     Who:
  153.     ───
  154.     Glen Gilbert  8:1006/0@fmlynet
  155.                   1:157/534@fidonet   (216)628-4860 data/fax
  156.  
  157.     Thanks Chris Mann 1:157/534.30.0@fidonet
  158.                       8:1006/0.30@fmlynet
  159.                       100:1/1.0@eaglenet
  160.  
  161.